<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <ui:composition xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:p="http://primefaces.org/ui" template="/layout/template.xhtml">
   <ui:define name="body">
   <script language="JavaScript" type="text/javascript">
		window.history.forward(-1);
	</script>
  <center><h1 class="title ui-widget-header ui-corner-all">#{message['modulo.proveedores.tittle']}</h1></center>  
     <h:form id="manteProList" prependId="false">
	<p:messages showDetail="true" escape="false" closable="true" />
	
	<p:toolbar>  
	    	<p:toolbarGroup align="left"> 
	
			<p:commandButton id="btnNuevo" value="#{message['proveedor.nuevo']}"  action="#{mantenimientoProveedorFormAction.agregar}"  
			 title="#{message['proveedor.tittle']}" icon="ui-icon-document"/>
			 <p:tooltip for="btnNuevo"/>
	
	  
	   </p:toolbarGroup>  
  		</p:toolbar>  
	   
	  <p:dataTable value="#{mantenimientoProveedorSearchAction.proveedorList}" var="p"
	   id="listaProveedor" paginator="true" rows="10"
       paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
	   rowsPerPageTemplate="5,10,15" widgetVar="table"
	   emptyMessage="#{message['rsltd.nocencontroregistro']}">
	   
	  <f:facet name="header">#{message['lista.proveedor.panel']}</f:facet>
	   <f:facet name="header">
	    <p:outputPanel>
		 <h:outputText value=" #{message['rsltd.buscar']}"/>
		 <p:inputText id="globalFilter" onkeyup="table.filter()" style="width:150px; align=Left; "/>
		</p:outputPanel>
	   </f:facet>
	   
       <p:column sortBy="#{p.codproveedor}" id="codigo" filterBy="#{p.codproveedor}" headerText="#{message['lista.codigo']}" >	   
	   <h:outputText value="#{p.codproveedor}" />
	   </p:column>
	   
	   
	    <p:column sortBy="#{p.numruc}" id="ruc" filterBy="#{p.numruc}" headerText="#{message['lista.nruc']}">
	    <h:outputText value="#{p.numruc}" />	     
	    </p:column>
	     
	     
	   <p:column sortBy="#{p.razonsocial}" id="razonsocialempresa" filterBy="#{p.razonsocial}" headerText="#{message['lista.razonsocial']}">
		<h:outputText value="#{p.razonsocial}" />
	   </p:column>
	     
	   <p:column sortBy="#{p.nombrecomercial}" id="nombrecomercial" filterBy="#{p.nombrecomercial}" headerText="#{message['lista.nombrecomercial']}">
	   <h:outputText value="#{p.nombrecomercial}" />
	   </p:column>  
	     
	    
	     
	     
	<p:column headerText="#{message['rsltd.verDetalle']}">
	    	<center>	
	    	<p:commandButton  id="btnDetalle" icon="ui-icon-zoomin"
	    update=":formManteProveDetalle:display" oncomplete="proveDialog.show()"
	     title="#{message['proveedor.tittleverdetalle']}" >
	 <f:setPropertyActionListener target="#{mantenimientoProveedorFormAction.selectedProveedor}" value="#{p}"  />
		</p:commandButton>
		<p:tooltip for="btnDetalle"/>
		</center>	
	   </p:column>
	
	
			   
		   
	<p:column headerText="#{message['rsltd.editar']}"  >
	<center>	
	    <p:commandButton ajax="false"  icon="ui-icon-pencil"  
 	id="btnEditar" title="#{message['proveedor.tittleeditar']}"
		 action="#{mantenimientoProveedorFormAction.update}">
		 <f:setPropertyActionListener value="#{p}" target="#{mantenimientoProveedorFormAction.objProveedor}" />
		</p:commandButton>
		<p:tooltip for="btnEditar"/>
		</center>	
	  
	   </p:column>
	
	<p:column headerText="#{message['rsltd.deshabilitar']}" >
	<center>	
	<p:commandButton   id="showConfirmDeshabilitarProveedor" icon="ui-icon-trash" onclick="confirmationProvee.show()" >
	<f:setPropertyActionListener target="#{mantenimientoProveedorFormAction.objProveedor}" value="#{p}" />	
	</p:commandButton>
	</center>	
	</p:column>





				
<f:facet name="footer">
					<div align="left">
						<p:commandLink value="#{message['lista.proveedoresdeshabilitados']}"
							icon="ui-icon-link" id="lista" action="#{mantenimientoProveedorFormAction.listar }"
							title="#{message['proveedor.tittlelistadeshabilitados']}">
							<f:setPropertyActionListener value="#{p}"
								target="#{mantenimientoProveedorFormAction.selectdeshabilitarProvee}" />
						</p:commandLink>
						<p:tooltip for="lista"/>
						
					</div>
				</f:facet>





			</p:dataTable>		
  </h:form>
 </ui:define>
</ui:composition>